﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace PernambucoImortal
{
    public partial class FSplash : Form
    {
        public FSplash()
        {
            InitializeComponent();
        }

        int Time = 1000;
        int Time2 = 500;

        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            Application.DoEvents();
            _Initialize();
        }

        private void _Initialize()
        {
            this.toolStripProgressBar1.Increment(5);
            Application.DoEvents();
            Thread.Sleep(Time);
            this.toolStripProgressBar1.Increment(15);
            this.toolStripStatusLabel1.Text = "Carregando Cidades...";
            Application.DoEvents();
            Thread.Sleep(Time);
            this.toolStripProgressBar1.Increment(8);
            this.toolStripStatusLabel1.Text = "Analisando fatores turísticos...";
            Application.DoEvents();
            Thread.Sleep(Time);
            this.toolStripProgressBar1.Increment(12);
            this.toolStripStatusLabel1.Text = "Carregando calendários...";
            Application.DoEvents();
            Thread.Sleep(Time);
            this.panel1.BackgroundImage = ((System.Drawing.Image)(PernambucoImortal.Properties.Resources._2));
            this.toolStripProgressBar1.Increment(5);
            this.toolStripStatusLabel1.Text = "Iniciando motor do AG...";
            Application.DoEvents();
            Thread.Sleep(Time2);
            this.toolStripProgressBar1.Increment(15);
            this.toolStripStatusLabel1.Text = "Analisando Operadores...";
            Application.DoEvents();
            Thread.Sleep(Time2);
            this.toolStripProgressBar1.Increment(10);
            this.toolStripStatusLabel1.Text = "Carregando população...";
            Application.DoEvents();
            Thread.Sleep(Time2);
            this.toolStripProgressBar1.Increment(3);
            this.toolStripStatusLabel1.Text = "Carregando características...";
            Application.DoEvents();
            Thread.Sleep(Time2);
            this.toolStripProgressBar1.Increment(7);
            this.toolStripStatusLabel1.Text = "Definindo Ambiente...";
            Application.DoEvents();
            Thread.Sleep(Time2);
            this.toolStripProgressBar1.Increment(2);
            this.toolStripStatusLabel1.Text = "Verificando sistema...";
            Application.DoEvents();
            Thread.Sleep(Time2);
            this.toolStripProgressBar1.Increment(8);
            this.toolStripStatusLabel1.Text = "Sistema verificado";
            Application.DoEvents();
            Thread.Sleep(Time2);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
